/// @file st-common.h
/// @brief Common data structures and types
/// @author Moose W. Oler
/// @version v0.1
/// @date 2011-06-04

#ifndef _ST_COMMON_H_
#define _ST_COMMON_H_

typedef unsigned char       st_uint8;
typedef signed char         st_sint8;
typedef unsigned short      st_uint16;
typedef signed short        st_sint16;
typedef unsigned int        st_uint32;
typedef signed int          st_sint32;
typedef unsigned long long  st_uint64;
typedef signed long long    st_sint64;

enum _st_boolean{
    ST_FALSE = 0,
    ST_TRUE = 1
};
typedef enum _st_boolean st_boolean;

enum _st_state{
    ST_OK = 0,
    ST_ERROR
};
typedef enum _st_state st_state;

/*******************************************************************************
 *  st_vertex_3d
 ******************************************************************************/
#define ST_MAKE_VEX3_SIZE       32
struct _st_vertex_3d{
    st_sint32 x;
    st_sint32 y;
    st_sint32 z;
};
typedef struct _st_vertex_3d st_vertex_3d;

extern st_vertex_3d* st_MakeVertex3(st_sint32 x, st_sint32 y, st_sint32 z);

/*******************************************************************************
 *  dynamic elements supervisor
 ******************************************************************************/
#define ST_MAX_DYNAMIC_ELEMENT_NUM  0x1000       // 4*1024
extern void          st_common_InitDES(void);
extern void          st_common_FreeDES(void);
extern st_boolean    st_Assigned(void* ptr);
extern void*         st_Allocate(st_uint32 size);
extern void          st_Free(void* ptr);

#endif

